package com.example.demo.controller;

import com.example.demo.entity.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2018/06/25 0025.
 */
/*
@RestController
public class TestController2 {

    @Autowired
    UserService userService;

    @RequestMapping("save2")
    public void save2() {
        User user = new User();
        user.setId(1L);
        user.setName("张海洋");
        user.setPwd("111");
        userService.saveUser(user);
    }

    @RequestMapping("query2")
    public User query2(String name) {
        return userService.findUserByUserName(name);
    }

    @RequestMapping("update2")
    public void update2(String name, String pwd) {
        User user = new User();
        user.setId(1L);
        user.setName(name);
        user.setPwd(pwd);
        userService.updateUser(user);
    }

    @RequestMapping("delete2")
    public void delete2() {
        userService.delUser(1L);
    }
}
*/
